/*  1:   */ package org.jetbrains.debugger;
/*  2:   */ 
/*  3:   */

import com.intellij.xdebugger.XDebuggerBundle;
import com.intellij.xdebugger.frame.presentation.XValuePresentation;
import com.intellij.xdebugger.frame.presentation.XValuePresentation.XValueTextRenderer;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.debugger.values.ObjectValue;
import org.jetbrains.debugger.values.StringValue;
import org.jetbrains.debugger.values.Value;

import java.util.List;

/*  4:   */
/*  5:   */
/*  6:   */
/*  7:   */
/*  8:   */
/*  9:   */
/* 10:   */
/* 11:   */ 
/* 12:   */ public class CustomPropertiesValuePresentation
/* 13:   */   extends XValuePresentation
/* 14:   */ {
/* 15:   */   private final ObjectValue a;
/* 16:   */   private final List<Variable> b;
/* 17:   */   
/* 18:   */   public CustomPropertiesValuePresentation(@NotNull ObjectValue paramObjectValue, @NotNull List<Variable> paramList)
/* 19:   */   {
/* 20:18 */     this.a = paramObjectValue;
/* 21:19 */     this.b = paramList;
/* 22:   */   }
/* 23:   */   
/* 24:   */   public void renderValue(@NotNull XValuePresentation.XValueTextRenderer paramXValueTextRenderer)
/* 25:   */   {
/* 26:24 */     if (paramXValueTextRenderer == null) {
/* 27:24 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/debugger/CustomPropertiesValuePresentation", "renderValue" }));
/* 28:   */     }
/* 29:24 */     paramXValueTextRenderer.renderComment(VariableView.getObjectValueDescription(this.a));
/* 30:25 */     paramXValueTextRenderer.renderSpecialSymbol(" {");
/* 31:26 */     int i = 1;
/* 32:27 */     for (Variable localVariable : this.b)
/* 33:   */     {
/* 34:28 */       if (i != 0) {
/* 35:29 */         i = 0;
/* 36:   */       } else {
/* 37:32 */         paramXValueTextRenderer.renderSpecialSymbol(", ");
/* 38:   */       }
/* 39:35 */       paramXValueTextRenderer.renderValue(localVariable.getName());
/* 40:36 */       paramXValueTextRenderer.renderSpecialSymbol(": ");
/* 41:   */       
/* 42:38 */       Value localValue = localVariable.getValue();
/* 43:39 */       assert (localValue != null);
/* 44:41 */       switch (1.$SwitchMap$org$jetbrains$debugger$values$ValueType[localValue.getType().ordinal()])
/* 45:   */       {
/* 46:   */       case 1: 
/* 47:   */       case 2: 
/* 48:   */       case 3: 
/* 49:45 */         paramXValueTextRenderer.renderKeywordValue(localValue.getValueString());
/* 50:46 */         break;
/* 51:   */       case 4: 
/* 52:49 */         paramXValueTextRenderer.renderNumericValue(localValue.getValueString());
/* 53:50 */         break;
/* 54:   */       case 5: 
/* 55:53 */         String str = localValue.getValueString();
/* 56:54 */         paramXValueTextRenderer.renderStringValue(str, "\"\\", 100);
/* 57:55 */         int j = (localValue instanceof StringValue) ? ((StringValue)localValue).getLength() : str.length();
/* 58:56 */         if (j > 100) {
/* 59:57 */           paramXValueTextRenderer.renderComment(XDebuggerBundle.message("node.text.ellipsis.truncated", new Object[] { Integer.valueOf(j) }));
/* 60:   */         }
/* 61:   */         break;
/* 62:   */       case 6: 
/* 63:62 */         paramXValueTextRenderer.renderComment(VariableView.trimFunctionDescription(localValue));
/* 64:63 */         break;
/* 65:   */       case 7: 
/* 66:66 */         paramXValueTextRenderer.renderComment(VariableView.getObjectValueDescription((ObjectValue)localValue));
/* 67:67 */         break;
/* 68:   */       default: 
/* 69:70 */         paramXValueTextRenderer.renderValue(localValue.getValueString());
/* 70:   */       }
/* 71:   */     }
/* 72:73 */     paramXValueTextRenderer.renderSpecialSymbol("}");
/* 73:   */   }
/* 74:   */ }



/* Location:           E:\idea\

 * Qualified Name:     org.jetbrains.debugger.CustomPropertiesValuePresentation

 * JD-Core Version:    0.7.0.1

 */